<%@ page contentType="text/html;charset=UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5shiv.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="static/element/index.css">
    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title></title>
    <style>
        .fail .layui-layer-content {
            background-color: brown;
            color: #eee;
            width: 480px;
            height: 30px;
            text-align: center;
        }

        .succeed .layui-layer-content {
            background-color: #0061A8;
            color: #eee;
            width: 400px;
            height: 30px;
            text-align: center;
        }

        * {
            padding: 0;
            margin: 0;
        }

        html {
            overflow-y: hidden;
        }

        body, html {
            width: 100%;
            height: 100%;
        }

        body {
            display: flex;
            flex-flow: column;
        }

        .fheader {
            height: 1%;
            min-height: 43px;
        }

        .fsection {
            /*flex-grow: 1;*/
            display: flex;
            flex-flow: row;
            /*height: 99%;*/
            min-height: 0;
        }

        .fnav {
            width: 360px;
            padding: 1px;
        }

        .farticle {
            flex: 1;
            padding: 1px;
        }

        .el-table__body tr:hover > td {
            background-color: #DFDFDF !important;
            cursor: default
        }

    </style>
</head>
<body>
<div id="app">
    <div class="fheader" style="padding: 0;margin: 0 ">
        <nav class="breadcrumb" style="height: 100%; padding: 0;margin: 0 ">
            <span class="l" style="color: #0000cc; padding: 0; margin: 0">当前部门：</span>
            <div class="l">{{currZzmc}} --> {{currBmmc}}</div>
            <span class="r" style="padding-top: 2px">共计员工：[&nbsp;<strong>{{iiCount}}</strong> 人]</span>
            <a class="btn btn-primary radius r" style="line-height:1.6em; margin-left: 5px; margin-right: 5px; margin-top: 6px" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
            <div class="r" style="margin-left: 20px; padding-top: 1px;"> 查询内容：
                <el-autocomplete
                        class="inline-input"
                        v-model="state2"
                        :fetch-suggestions="querySearch"
                        placeholder="请输入内容"
                        clearable
                        @select="handleSelect">
                </el-autocomplete>
                <button @click="fSearchKh()" class="btn btn-success radius" name=""><i class="Hui-iconfont">&#xe665;</i>按卡号查询</button>
            </div>
        </nav>
    </div>
    <div class="fsection">
        <div class="fnav">
            <el-table :data="tableTree" stripe border style="width: 100%" :height="tableHeight" empty-text="没有数据" :header-cell-style="tableHeaderCellStyle" :cell-style="tableCellStyle" @row-click="fClickRow" v-loading.fullscreen.lock="fullscreenLoading">
                <el-table-column prop="VALUE01" label="组织名称" width="190"></el-table-column>
                <el-table-column prop="VALUE02" label="部门名称" width="150"></el-table-column>
            </el-table>
        </div>
        <div class="farticle">
            <div class="cl pd-5 bg-1 bk-gray" style="margin-top: 3px">
                <span class="l">
                    <a href="javascript:" @click="fAdd" class="btn btn-primary radius" id="add"><i class="Hui-iconfont">&#xe600;</i> 新增</a>
                    <span style="padding-top: 3px">当前组织 ：[{{currZzmc}}] </span>
                </span>
            </div>
            <div style="height: 100%; width: 100%; overflow: scroll; float: left; overflow-x: hidden;">
                <el-table :data="tableData" stripe border style="width: 100%" :height="tableHeightL" empty-text="没有数据" :header-cell-style="tableHeaderCellStyleL" :cell-style="tableCellStyleL">
                    <el-table-column prop="VALUE01" label="姓名" width="90"></el-table-column>
                    <el-table-column prop="VALUE02" label="工号" width="110"></el-table-column>
                    <el-table-column prop="VALUE03" label="部门" width="110"></el-table-column>
                    <el-table-column prop="VALUE04" label="人员类别" width="90"></el-table-column>
                    <el-table-column prop="VALUE05" label="消费类别" width="110"></el-table-column>
                    <el-table-column prop="VALUE08" label="电话号码"></el-table-column>
                    <el-table-column label="操作" show-overflow-tooltip width="460">
                        <template slot-scope="scope">
                            <input class="btn btn-secondary-outline radius" type="button" value="编辑" @click="adminEdit('人员信息修改',scope.row,'800','600')" style="width: 50px;text-align: center">
                            <el-button type="primary" @click="fDsbk('补换卡',scope.row)" size="mini" style="width: 60px; margin: 1px;padding-left: 0;padding-right: 0;">补换卡</el-button>
                            <input class="btn btn-danger-outline radius" type="button" value="注销" @click="fZx(scope.row)" style="width: 50px;text-align: center">
                            <el-button type="primary" @click="fKk('卡注销',scope.row)" size="mini" style="width: 60px; padding-left: 0;padding-right: 0; margin: 1px;">卡注销</el-button>
                            <el-button v-if="scope.row.VALUE17 === '正常'" type="primary" @click="fGsJg('挂失',scope.row)" size="mini" style="width: 60px; padding-left: 0;padding-right: 0; margin: 1px;">卡挂失</el-button>
                            <el-button v-else type="primary" @click="fGsJg('解挂',scope.row)" size="mini" style="width: 60px;padding-left: 0;padding-right: 0; margin: 1px; color: yellow">卡解挂</el-button>
                            <input class="btn btn-warning-outline radius" type="button" :value="scope.row.VALUE17==='冻结'?'解冻':'冻结'" @click="fDj(scope.row)" style="width: 50px;text-align: center">
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </div>
    </div>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="static/axios.min.js"></script>
<script type="text/javascript" src="./static/vue"></script>
<script src="static/element/index.js"></script>
<script type="text/javascript">
    let vm = new Vue({
        el: '#app',
        data: {
            state2: '',
            restaurants: [],
            cxfs: '',
            tableHeight: 0,
            tableHeightL: 0,
            currZzbh: '',
            currZzmc: '',
            currBmbh: '',
            currBmmc: '',
            currDqlx: '',  //--标识出当前是部门还是公司

            ii_page: 1,   //--上一页下一页的计数器
            ii_row: 20,   //--每页显示的记录数
            iiCount: 0,
            is_search: '',
            tableTree: [],      //--部门表
            tableData: [],      //--具体人员信息表
            tableRylb: [],      //--人员类别
            tableXflb: [],      //--消费类别
            lock: false,
            currXflb: '',
            fullscreenLoading: false
        },
        methods: {
            //--挂失解挂
            fGsJg(title, obj) {
                if (obj.VALUE17.toString() === '冻结') {
                    layer.msg('<span style="font-size:24px; line-height: 30px">该人员已冻结，无法进行相关操作!</span>', {time: 1500, skin: 'fail'});
                    return
                }

                let ls_opid = "${sessionOpid}";
                let self = this
                layer.open({
                    type: 2,
                    area: ['800px', '600px'],
                    fix: false, //不固定
                    maxmin: false,
                    shade: 0.4,
                    title: title,
                    content: ['w_zxkj_cardgs.jsp', 'no'],
                    success: function (layero, index) {
                        let body = layer.getChildFrame('body', index);//少了这个是不能从父页面向子页面传值的
                        const iframeWin = window[layero.find('iframe')[0]['name']];   //--通过将弹出的layer窗口中将vue中的函数在created周期中赋给windows，
                                                                                      //--然后用本变量进行访问，由此可以达到操作弹出layer界面的功能，该功能重要中的重要几句是layer的seccess回调，需要加强理解
                        iframeWin.fInit({
                            "opid": ls_opid,
                            "btnText": title,
                            "tableEmp": obj,
                            "tableTree": self.tableTree,
                            "tableRylb": self.tableRylb,
                            "tableXflb": self.tableXflb
                        })
                    },
                });
            },

            //--丢失补卡
            fDsbk(title, obj) {
                if (obj.VALUE16.toString() === '冻结') {
                    layer.msg('<span style="font-size:24px; line-height: 30px">该人员已被冻结，无法进行相关操作!</span>', {time: 1500, skin: 'fail'});
                    return
                }

                let ls_opid = "${sessionOpid}";
                let self = this
                layer.open({
                    type: 2,
                    area: ['800px', '600px'],
                    fix: false, //不固定
                    maxmin: false,
                    shade: 0.4,
                    title: title,
                    content: ['w_zxkj_carddsbk.jsp', 'no'],
                    success: function (layero, index) {
                        const iframeWin = window[layero.find('iframe')[0]['name']];   //--通过将弹出的layer窗口中将vue中的函数在created周期中赋给windows，
                        iframeWin.fInit({
                            "opid": ls_opid,
                            "btnText": title,
                            "tableEmp": obj,
                            "tableTree": self.tableTree,
                            "tableRylb": self.tableRylb,
                            "tableXflb": self.tableXflb
                        })
                    },
                });
            },

            fDj(obj) {
                let msg = ''
                let ls_opid = "${sessionOpid}";
                let self = this
                if (obj.VALUE17 !== '冻结') {
                    msg = '冻结'
                } else {
                    msg = '解冻'
                }
                layer.confirm("请问是否确定对该人员进行" + msg + "操作？", {
                    btn: ["确定", "取消"] //按钮
                }, function () {
                    if (!this.lock) {
                        this.lock = true
                        let params = new URLSearchParams();
                        params.append('CMD', "ZT");
                        params.append('VALUE01', obj.VALUE10);
                        params.append('VALUE02', msg);
                        params.append('VALUE03', ls_opid);
                        axios.post('/f_wscl/com2', params)
                            .then(function (res) {
                                let {db1} = res.data
                                if (db1[0].VALUE01 === 'ZZ01') {
                                    layer.msg('<span style="font-size:26px; line-height: 30px">' + db1[0].VALUE02 + '</span>', {time: 2000, skin: 'fail'});
                                } else if (db1[0].VALUE01 === 'ZZ00') {
                                    layer.msg("<span style='font-size:26px; line-height: 30px'>" + msg + "操作完毕!</span>", {time: 2000, skin: 'succeed'}, function () {
                                        let index = parent.layer.getFrameIndex(window.name);
                                        self.fGetinfoEmp()
                                        parent.layer.close(index);
                                    });
                                }
                            })
                            .catch(function (error) {
                                layer.msg('<span style="font-size:26px; line-height: 30px">网络异常错误!</span>', {time: 1500, skin: 'fail'});
                            })
                            .finally(function () {
                                self.lock = false
                            });
                    }
                    //--如下两个备注留着，用来确定是否关闭弹出的界面而不关闭显示流水的列表界面
                    // layer.closeAll('dialog');
                    // layer.close(index);
                }, function () {
                });
            },

            //--卡注销
            fKk(title, obj) {
                if (obj.VALUE19.toString().substr(0, 4) === '9999') {
                    layer.msg('<span style="font-size:24px; line-height: 30px">虚拟卡无需注销!</span>', {time: 2000, skin: 'fail'});
                    return
                }

                let ls_opid = "${sessionOpid}";
                let self = this
                layer.confirm("是否确定进行卡注销？", {
                    btn: ["确定", "取消"] //按钮
                }, function () {
                    if (!this.lock) {
                        this.lock = true
                        let params = new URLSearchParams();
                        params.append('CMD', "BQ");
                        params.append('VALUE01', obj.VALUE10);
                        params.append('VALUE02', ls_opid);
                        axios.post('/f_wscl/com2', params)
                            .then(function (res) {
                                let {db1} = res.data
                                if (db1[0].VALUE01 === 'ZZ01') {
                                    layer.msg('<span style="font-size:26px; line-height: 30px">' + db1[0].VALUE02 + '</span>', {time: 2000, skin: 'fail'});
                                } else if (db1[0].VALUE01 === 'ZZ00') {
                                    layer.msg("<span style='font-size:26px; line-height: 30px'>卡注销完毕!</span>", {time: 2000, skin: 'succeed'}, function () {
                                        let index = parent.layer.getFrameIndex(window.name);
                                        self.fGetinfoEmp()
                                        parent.layer.close(index);
                                    });
                                }
                            })
                            .catch(function (error) {
                                layer.msg('<span style="font-size:26px; line-height: 30px">网络异常错误!</span>', {time: 1500, skin: 'fail'});
                            })
                            .finally(function () {
                                self.lock = false
                            });
                    }
                    //--如下两个备注留着，用来确定是否关闭弹出的界面而不关闭显示流水的列表界面
                    // layer.closeAll('dialog');
                    // layer.close(index);
                }, function () {
                });
            },

            //--注销
            fZx(obj) {
                let showMsg = '';
                if (parseFloat(obj.VALUE18.toString()) > 1.0)
                {
                    showMsg = '该账户尚有金额，是否强行注销？'
                }
                else{
                    showMsg = '是否确定对该人员进行注销操作?？'
                }

                let ls_opid = "${sessionOpid}";
                let self = this
                layer.confirm('<span style="font-size:22px;' +
                    'line-height: 30px;' +
                    ' color: brown;">' +
                    showMsg +
                    '</br>当前余额: ' +
                    obj.VALUE18 +
                    '</span>',
                    {
                        title:['信息确认', 'font-size:16px; font-weight:blod; background:brown; color:#eee'],
                        area:['450px','190px'], //弹框的大小
                        btn: ["确定", "取消"] //按钮
                    }, function () {
                        if (!this.lock) {
                            this.lock = true
                            let params = new URLSearchParams();
                            params.append('CMD', "BF");
                            params.append('VALUE01', obj.VALUE10);
                            params.append('VALUE02', ls_opid);
                            axios.post('/f_wscl/com2', params)
                                .then(function (res) {
                                    let {db1} = res.data
                                    if (db1[0].VALUE01 === 'ZZ01') {
                                        layer.msg('<span style="font-size:26px; line-height: 30px">' + db1[0].VALUE02 + '</span>', {time: 2000, skin: 'fail'});
                                    } else if (db1[0].VALUE01 === 'ZZ00') {
                                        layer.msg("<span style='font-size:26px; line-height: 30px'>注销完毕!</span>", {time: 2000, skin: 'succeed'}, function () {
                                            let index = parent.layer.getFrameIndex(window.name);
                                            self.fGetinfoEmp()
                                            parent.layer.close(index);
                                        });
                                    }
                                })
                                .catch(function (error) {
                                    layer.msg('<span style="font-size:26px; line-height: 30px">网络异常错误!</span>', {time: 1500, skin: 'fail'});
                                })
                                .finally(function () {
                                    self.lock = false
                                });
                        }
                        //--如下两个备注留着，用来确定是否关闭弹出的界面而不关闭显示流水的列表界面
                        // layer.closeAll('dialog');
                        // layer.close(index);
                    }, function () {
                    });
            },

            fClickRow(row, column, event) {
                this.currZzbh = row.VALUE05
                this.currZzmc = row.VALUE06
                this.currBmbh = row.VALUE04
                this.currBmmc = row.VALUE02
                this.currDqlx = row.VALUE03

                this.fGetinfoEmp()
            },

            tableHeaderCellStyle({row, column, rowIndex, columnIndex}) {
                let cellStyle1;
                let cellStyle2;

                cellStyle1 = "color: #fff;" +
                    "background:#4F4F4F;" +
                    "text-align:center;" +
                    "font-size:14px"

                cellStyle2 = "color: #eee;" +
                    "background:#4F4F4F;" +
                    "text-align:center;" +
                    "display:none;" +
                    "font-size:14px"

                if (columnIndex > 1) {
                    return cellStyle2;
                } else {
                    return cellStyle1
                }
            },

            tableCellStyle({row, column, rowIndex, columnIndex}) {
                let cellStyle1;
                let cellStyle2;

                cellStyle1 = "text-align:center;" +
                    "padding:3px;" +
                    "font-size:14px"
                cellStyle2 = "text-align:left;" +
                    "padding:3px;" +
                    "font-size:14px"

                if (columnIndex === 0) {
                    return cellStyle1;
                } else if (columnIndex === 1) {
                    return cellStyle2
                }
            },

            tableHeaderCellStyleL({row, column, rowIndex, columnIndex}) {
                let cellStyle1;

                cellStyle1 = "color: #fff;" +
                    "background:#4F4F4F;" +
                    "text-align:center;" +
                    "font-size:14px"

                return cellStyle1
            },

            tableCellStyleL({row, column, rowIndex, columnIndex}) {
                let cellStyle1;

                if (columnIndex === 6) {
                    cellStyle1 = "text-align:left;" +
                        "padding:8px 1px 8px;" +
                        "font-size:12px"
                } else {
                    cellStyle1 = "text-align:center;" +
                        "padding:8px 1px 8px;" +
                        "font-size:12px"
                }
                return cellStyle1;
            },

            fAdd() {
                if (this.currDqlx !== '2') {
                    layer.msg('请选择部门信息!', {icon: 0, time: 2000});
                    return
                }
                //--首先获取最大的编号，虽然获取的编号是个虚的
                let ls_opid = "${sessionOpid}";
                let self = this
                let params = new URLSearchParams();
                params.append('CMD', "ZQ");
                params.append('VALUE01', "Z_EMP");
                params.append('VALUE02', ls_opid);

                axios.post('/f_wscl/com2', params)
                    .then(function (res) {
                        let {db1} = res.data
                        console.log(db1);
                        self.adminInsert('人员信息新增', db1[0], '800', '640', "INSERT", self.currXflb)
                    })
                    .catch(function (error) {
                        layer.msg('网络异常错误', {icon: 1, time: 1000});
                    });
            },

            fRefresh() {
                this.fGetinfo();
            },

            //--查询出左边的部门信息以及相关下拉数据
            fGetinfo() {
                let ls_opid = "${sessionOpid}";
                let self = this
                let params = new URLSearchParams();
                params.append('CMD', "ZO");
                params.append('VALUE01', ls_opid);

                axios.post('/f_wscl/com2', params)
                    .then(function (res) {
                        //--db1左边表结构的树  db2人员分类
                        let {db1, db2, db4} = res.data
                        self.tableTree = db1
                        self.tableRylb = db2
                        // self.tableXflb = db3
                        self.restaurants = JSON.parse(JSON.stringify(db4).replace(/VALUE01/g, "value")
                            .replace(/VALUE02/g, "address"));
                    })
                    .catch(function (error) {
                        layer.msg('<span style="font-size:26px; line-height: 30px">网络异常错误!</span>', {time: 1500, skin: 'fail'});
                    });
            },

            //--查询出左边的部门信息以及相关下拉数据
            fGetinfoEmp() {
                if (this.currDqlx ==='1')
                {
                    return
                }
                let self = this
                let params = new URLSearchParams();
                params.append('CMD', "ZN");
                params.append('VALUE01', this.currBmbh);
                params.append('VALUE02', this.currZzbh);
                this.fullscreenLoading = true
                axios.post('/f_wscl/com2', params)
                    .then(function (res) {
                        //--db1左边表结构的树  db2人员分类
                        let {db1, db2, db3, db4} = res.data
                        self.tableData = db1
                        self.iiCount = db2[0].VALUE01.toString()
                        self.currXflb = db3[0].VALUE02.toString()
                        self.tableXflb = db4

                        if (self.tableXflb.length === 0){
                            self.currXflb = ''
                        }
                    })
                    .catch(function (error) {
                        layer.msg('<span style="font-size:26px; line-height: 30px">网络异常错误!</span>', {time: 1500, skin: 'fail'});
                    }).finally(function () {
                    self.lock = false
                    self.fullscreenLoading = false
                });
            },

            /*编辑和新增*/
            //--   jud=0修改    jud=1新增
            adminInsert(title, obj, w, h, jud, xflb) {
                if (title == null || title === '') {
                    title = false;
                }
                if (w == null || w === '') {
                    w = 800;
                }
                if (h == null || h === '') {
                    h = ($(window).height() - 50);
                }
                let ls_opid = "${sessionOpid}";
                let self = this
                layer.open({
                    type: 2,
                    area: [w + 'px', h + 'px'],
                    fix: false, //不固定
                    maxmin: false,
                    shade: 0.4,
                    title: title,
                    content: ['w_zxkj_empinsert.jsp', 'no'],
                    success: function (layero, index) {
                        let body = layer.getChildFrame('body', index);//少了这个是不能从父页面向子页面传值的
                        const iframeWin = window[layero.find('iframe')[0]['name']];   //--通过将弹出的layer窗口中将vue中的函数在created周期中赋给windows，
                                                                                      //--然后用本变量进行访问，由此可以达到操作弹出layer界面的功能，该功能重要中的重要几句是layer的seccess回调，需要加强理解
                        iframeWin.fInit({
                            "opid": ls_opid,
                            "do": jud,
                            'zzmc': self.currZzmc,
                            'bmvalue': self.currBmbh,
                            "tableTree": self.tableTree,
                            "tableEmp": obj,
                            "tableRylb": self.tableRylb,
                            "tableXflb": self.tableXflb,
                            "currXflb": self.currXflb
                        })
                    },
                });
            },

            adminEdit(title, obj, w, h, jud, xflb) {
                if (title == null || title === '') {
                    title = false;
                }
                if (w == null || w === '') {
                    w = 800;
                }
                if (h == null || h === '') {
                    h = ($(window).height() - 50);
                }
                let ls_opid = "${sessionOpid}";
                let self = this
                layer.open({
                    type: 2,
                    area: [w + 'px', h + 'px'],
                    fix: false, //不固定
                    maxmin: false,
                    shade: 0.4,
                    title: title,
                    content: ['w_zxkj_empedit.jsp', 'no'],
                    success: function (layero, index) {
                        let body = layer.getChildFrame('body', index);//少了这个是不能从父页面向子页面传值的
                        const iframeWin = window[layero.find('iframe')[0]['name']];   //--通过将弹出的layer窗口中将vue中的函数在created周期中赋给windows，
                                                                                      //--然后用本变量进行访问，由此可以达到操作弹出layer界面的功能，该功能重要中的重要几句是layer的seccess回调，需要加强理解
                        iframeWin.fInit({
                            "opid": ls_opid,
                            'zzmc': self.currZzmc,
                            'bmvalue': self.currBmbh,
                            "tableTree": self.tableTree,
                            "tableEmp": obj,
                            "tableRylb": self.tableRylb,
                            "tableXflb": self.tableXflb,
                            "currXflb": self.currXflb
                        })
                    },
                });
            },

            querySearch(queryString, cb) {
                let restaurants = this.restaurants;
                let results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
                // 调用 callback 返回建议列表的数据
                cb(results);
            },

            createFilter(queryString) {
                return (restaurants) => {
                    return (restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >= 0);
                };
            },

            //--输入框选择后的人员帐号
            handleSelect(item) {
                this.ryzh = item.address
                this.cxfs = 'ZH'
                this.fSearch1()
            },

            //--依据选择的人员查询出基本信息
            fSearch1() {
                let ls_opid = "${sessionOpid}";
                let self = this
                let params = new URLSearchParams();
                params.append('CMD', "ZS");
                params.append('VALUE01', this.ryzh);
                params.append('VALUE02', this.cxfs);
                params.append('VALUE03', ls_opid);
                axios.post('/f_wscl/com2', params)
                    .then(function (res) {
                        let {db1, db2, db3} = res.data
                        if (db3[0].VALUE01 === 'ZZ01') {
                            layer.msg('<span style="font-size:24px; line-height: 30px">' + db3[0].VALUE02 + '</span>', {time: 2000, skin: 'fail'});
                        } else {
                            self.tableData = db1
                            self.currZzbh = db2[0].VALUE01
                            self.currZzmc = db2[0].VALUE02
                            self.currBmbh = db2[0].VALUE03
                            self.currBmmc = db2[0].VALUE04
                        }
                    })
                    .catch(function (error) {
                        layer.msg('<span style="font-size:26px; line-height: 30px">网络异常错误!</span>', {time: 1500, skin: 'fail'});
                    });
            },

            //--按照输入的卡号进行查询
            fSearchKh() {
                let self = this
                layer.prompt({
                    formType: 0,
                    value: '',
                    title: '请读卡',
                    maxlength: 15,
                    area: ['300px', '120px'] //自定义文本域宽高
                }, function (value, index, elem) {
                    if (isNaN(value)) {
                        layer.msg('<span style="font-size:26px; line-height: 30px">请读出数字卡号!</span>', {time: 1500, skin: 'fail'});
                        return;
                    }
                    self.ryzh = value
                    self.cxfs = 'KH'
                    self.fSearch1()
                    layer.close(index);
                }, function () {
                });
            },
        },
        mounted() {
            window.fGetinfoEmp = this.fGetinfoEmp;
        },
        created() {
            let windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
            this.tableHeight = windowHeight - 42;
            this.tableHeightL = windowHeight - 135;
            this.fGetinfo()
        }
    });
</script>

</body>
</html>
